Integration Strategies

Your Name Goes Here

Introduction

The goal of this notebook is to introduce you to Mathematica’s integration capabilities. We will introduce you to the Integrate command, which will allow you to compute integrals that may be tedious to do by hand.

We also introduce the Plot command to help visualize the graph of a function and to visualize the area under a curve.

Mathematica is also called a computer algebra system. This means it helps do tedious mathematical operations such as partial fractions and polynomial long division. We will introduce commands to help us perform these operations.

Mathematica Commands

Integrate

To compute integrals in Mathematica, we use the Integrate command.

Indefinite Integrals

Integrate[f, x] gives the indefinite integral ∫f dx. For example, ∫ (x^2) dx can be computed as:

Integrate[x^2,x]

Definite Integrals

Integrate[f, {x, a, b}] gives the definite integral (∫_a^b)f dx. For example, (∫_1^3)(x^2) dx can be computed as:

Integrate[x^2,{x,1,3}]

Plot

Plot[f, {x, xmin, xmax}] generates a plot of f as a function of x from xmin to xmax. For example, we can plot the function f(x)=(x^2) on the interval [1,3]:

Plot[x^2,{x,1,3}]

We can gain extra functionality by adding options to the Plot command. An option is given as an additional argument to Plot and is written like: optionName -> optionValue. For example, to visualize the area under a curve we use the option Filling and give it the value Bottom:

Plot[x^2,{x,1,3},Filling->Bottom]

Apart

Apart[expr] rewrites a rational expression expr as a sum of terms with minimal denominators. This command is useful when doing partial fractions. For instance, we can split (1/((x^2)-3 x+2))=(1/((x-2)(x-1))) up by doing:

Apart[1/(x^2-3 x+2)]

PolynomialQuotientRemainder

PolynomialQuotientRemainder[p, q, x] gives a list of the quotient and remainder of p and q, treated as polynomials in x. This comand is useful when doing polynomial long division. For instance, if we want to do the division (p/q)=((-3+6 x-2 (x^2)+2 (x^5)-3 (x^6)+(x^7))/(2-3 x+(x^2))) then we would do:

PolynomialQuotientRemainder[-3+6 x-2 x^2+2 x^5-3 x^6+x^7,2-3 x+x^2,x]

The first element in the list is the quotient and the second element in the list is the remainder. This allow us to write ((-3+6 x-2 (x^2)+2 (x^5)-3 (x^6)+(x^7))/(2-3 x+(x^2)))=quotient+ (remainder/divisor)=(-2+(x^5))+(1/(2-3 x+(x^2))).

Limit

Limit[expr, x -> x0] finds the limiting value of expr when x approaches x0. For instance, if we want to compute (lim_(x->∞))(1/x) we do:

Limit[1/x, x->Infinity]

This allows us to compute improper integrals as well. For instance, (∫_1^∞)(1/x)dx=(lim_(t->∞))(∫_1^t)(1/x)dx which is written as:

Limit[Integrate[1/x,{x,1,t}],t->Infinity]

A shorthand for computing an improper integral is:

Integrate[1/x,{x,1,Infinity}]

Notice that the result you get is slightly different.

Problems

Problem 1

Here, we will observe that Mathematica can help us perform integrals extremely quickly and answer basic questions.

Compute the antiderivative of f(x)=(1/(x+(x^(1/3)))).

Which integration technique(s) would you use to compute the antiderivative above?

Answer:

Find the area under of the curve of y=(1/(x+(x^(1/3)))) on the interval [2,4].

Visualize the area under the curve of y=(1/(x+(x^(1/3)))) on the interval [2,4].

Problem 2

Not every function has a closed form antiderivative, as we will observe in the following problem.

Compute the antiderivative of f(x)=(e^(-(x^2))).

You cannot do this integral by hand because the function f(x)=(e^(-(x^2))) is not an elementary function; it is called a Gaussian function. Gaussian functions are widely used in statistics where they describe the normal distributions. Because an integral will always exist for a continuous function and f(x) is a continuous function, Mathematica returns an answer to this integral. This integral can be computed to arbitrary numerical precision.

Compute (∫_(-2)^2)(e^(-(x^2)))dx.

Visualize the area under the curve of y=(e^(-(x^2))) on the interval [-2,2].

Problem 3

Mathematica can help us identify patterns, as we will see in the following problem.

Compute ∫ln(x) dx.

Note: In Mathematica, ln(x) is represented as Log[x].

If you were to compute ∫ln(x) dx by hand, what would you use for u and dv when doing integration by parts?

u: 
dv:

Compute ∫x ln(x) dx.

If you were to compute ∫x ln(x) dx by hand, what would you use for u and dv when doing integration by parts?

u: 
dv:

Compute ∫(x^3) ln(x) dx.

Compute ∫(x^5) ln(x) dx.

Based on the pattern you see in the previous four integrals, report what you believe ∫(x^n) ln(x) dx is, where n≥1.

Answer:

Predict ∫(x^7) ln(x) dx using your answer above.

Answer:

Compute ∫(x^7) ln(x) dx.

Problem 4

In this problem we will investigate partial fractions.

Compute the antiderivative of f(x)=(2/((x^2)-6 x+8)).

Which integration technique(s) would you use to compute the antiderivative above?

Answer:

Use the Apart command to split f(x)=(2/((x^2)-6 x+8)) in to separate pieces. Compute the antiderivative of each piece. Compare your answers to that of the antiderivative of f(x).

Compute the antiderivative of g(x)=((-14+12 x-2 (x^2)+8 (x^4)-6 (x^5)+(x^6))/(8-6 x+(x^2))).

Use the PolynomialQuotientRemainder command to rewrite g(x)=((-14+12 x-2 (x^2)+8 (x^4)-6 (x^5)+(x^6))/(8-6 x+(x^2))) in the form g(x) = quotient + (remainder/divisor). Compare the expression for (remainder/divisor) to f(x).

quotient:  
remainder: 
divisor:

Compute the antiderivative of the quotient from the previous problem. Compare your answer to the antiderivative of g(x).

Problem 5

In this problem we will investigate improper integrals.

Compute (∫_0^∞)(e^(-(x^2)))dx using the Limit and Integrate commands.

Compute (∫_0^∞)(e^(-(x^2)))dx using a single Integrate command.

Compute (∫_(-∞)^∞)(e^(-(x^2)))dx using the Limit and Integrate commands.

Hint: Split the integral in to two integrals.

Compute (∫_(-∞)^∞)(e^(-(x^2)))dx using a single Integrate command.